81 WDT_A_hold(WDT_A_BASE);
90 ADC10_A_init(ADC10_A_BASE,
91 ADC10_A_SAMPLEHOLDSOURCE_SC,
92 ADC10_A_CLOCKSOURCE_ADC10OSC,
93 ADC10_A_CLOCKDIVIDER_1);
95 ADC10_A_enable(ADC10_A_BASE);
102 ADC10_A_setupSamplingTimer(ADC10_A_BASE,
103 ADC10_A_CYCLEHOLD_16_CYCLES,
104 ADC10_A_MULTIPLESAMPLESDISABLE);
113 ADC10_A_configureMemory(ADC10_A_BASE,
116 ADC10_A_VREFNEG_AVSS);
120 while ( REF_BUSY == Ref_isRefGenBusy(REF_BASE) ) ;
122 Ref_setReferenceVoltage(REF_BASE,
125 Ref_enableReferenceVoltage(REF_BASE);
133 GPIO_setAsOutputPin(GPIO_PORT_P1,
146 ADC10_A_startConversion(ADC10_A_BASE,
147 ADC10_A_SINGLECHANNEL);
151 while ( REF_BUSY == Ref_isRefGenBusy(REF_BASE) ) ;
156 Ref_setReferenceVoltage(REF_BASE,
162 Ref_setReferenceVoltage(REF_BASE,
169 while (!(ADC10_A_getInterruptStatus(ADC10_A_BASE,
173 if (ADC10_A_getResults(ADC10_A_BASE) > 500){
194 for (
i = 0x7FFF;
i > 0;
i--){}
GPIO_setOutputHighOnPin(GPIO_PORT_LED1|GPIO_PORT_LED2, GPIO_PIN_LED1|GPIO_PIN_LED2)
GPIO_setOutputLowOnPin(GPIO_PORT_LED1|GPIO_PORT_LED2, GPIO_PIN_LED1|GPIO_PIN_LED2)